package com.momo.partitioner;

import org.apache.kafka.clients.producer.Partitioner;
import org.apache.kafka.common.Cluster;

import java.util.Map;

/**
 * @author ：朱博
 * @description：TODO
 * @date ：2021/3/21 21:09
 */
public class MyPartitioner implements Partitioner {
    /**
     *
     * @param topic
     * @param key
     * @param bytes
     * @param o1
     * @param bytes1
     * @param cluster 集群消息
     * @return
     */
    @Override
    public int partition(String topic, Object key, byte[] bytes, Object o1, byte[] bytes1, Cluster cluster) {
        return 2;
    }

    @Override
    public void close() {

    }

    @Override
    public void configure(Map<String, ?> map) {

    }
}
